package com.drug.mingkang.mapper;


import com.drug.mingkang.model.HqPurchasedetails;
import com.drug.mingkang.model.vo.PurchasedetailsVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;

/**
 * 采购明细(HqPurchasedetails)表数据库访问层
 *
 * @author wenchangjian
 * @since 2020-08-11 12:00:13
 */
public interface HqPurchasedetailsMapper {

    /**
     * 通过ID查询单条数据
     *
     * @param detailsId 主键
     * @return 实例对象
     */
    HqPurchasedetails queryById(String detailsId);

    /**
     * 查询指定行数据
     *
     * @param purchasedetailsVo
     * @return 对象列表
     */
    List<HqPurchasedetails> queryAllByLimit(PurchasedetailsVo purchasedetailsVo);


    /**
     * 通过实体作为筛选条件查询
     *
     * @param hqPurchasedetails 实例对象
     * @return 对象列表
     */
    List<HqPurchasedetails> queryAll(HqPurchasedetails hqPurchasedetails);

    /**
     * 新增数据
     *
     * @param hqPurchasedetails 实例对象
     * @return 影响行数
     */
    int insert(HqPurchasedetails hqPurchasedetails);

    /**
     * 修改数据
     *
     * @param hqPurchasedetails 实例对象
     * @return 影响行数
     */
    int update(HqPurchasedetails hqPurchasedetails);

    /**
     * 通过主键删除数据
     *
     * @param detailsId 主键
     * @return 影响行数
     */
    int deleteById(String detailsId);

    int selectCount(PurchasedetailsVo purchasedetailsVo);

    int deleteByPurchaseId(String purchaseId);

    boolean deleteMaterial(String materialId, String purchaseId);

    boolean updateMaterial(String materialId, String purchaseId, int count);

    List<PurchasedetailsVo> selectPurchaseSumprice(String purchaseId);

    boolean deleteMaterials(String purchaseId);

    List<Map<String, Object>> queryAllmaterial(String purchaseId);
}